<?php
/**
 * algorithms's name:桶排序
 * time:2015-11-26
 */
$in = [1,3,5,7,9,4,2,5,7,8,5,4,3,2,7,5,8,9,4,2,1,3,5,7,9,4,2,5,7,8,5,4,3,2,7,5,8,9,4,2,1,3,5,7,9,4,2,5,7,8,5,4,3,2,7,5,8,9,4,2,1,3,5,7,9,4,2,5,7,8,5,4,3,2,7,5,8,9,4,2,1,3,5,7,9,4,2,5,7,8,5,4,3,2,7,5,8,9,4,2];
function showtime() {
	echo microtime() . "\n";
}
function showinInfo($in) {
	echo 'data\'s length: ' . count($in) . "\n";
}
showinInfo($in);
showtime();
$a = [];
for ($i=0; $i <= 10; $i++) { 
	$a[$i] = 0;
}
foreach ($in as $k => $v) {
	$a[$v] += 1;
}
for ($i=10; $i >= 0 ; $i--) { 
	for ($j=1; $j <= $a[$i] ; $j++) { 
		echo $i. ' ';
	}
}
echo "\n";
showtime();